<?php 
	$active = isset($active) ? $active : 'inbox';
	$unread_display = '';
	if(isset($unread_count) && $unread_count != 0) {
		$unread_display = " ($unread_count)";
	}
	$id_param = isset($message_id) ? "&id=$message_id" : '';
?>
<div class="filter-links with-icon no-bg">
	<ul>
		<li class="<?php echo $active == 'inbox' ? 'current' : '' ?>">
			<?php echo link_to('Inbox'.$unread_display, 
				'messages/index?group_id='.$group_id.'&folder='.MessagePeer::INBOX_FOLDER) ?>
		</li>
		<li class="<?php echo $active == 'sent' ? 'current' : '' ?>">
			<?php echo link_to('Sent', 
				'messages/index?group_id='.$group_id.'&folder='.MessagePeer::SENT_FOLDER) ?>
		</li>
		<li>
			<?php echo link_to('Delete', 'messages/delete?group_id='.$group_id.$id_param, array('id' => 'deleteMessage')) ?>
		</li>
		
		<?php if($active == 'inbox'): ?>
		<li>
			<?php echo link_to('Mark as Unread', 'messages/update?group_id='.$group_id.'&seen=0'.$id_param, array('id' => 'markUnread')) ?>
		</li>
		<li>
			<?php echo link_to('Mark as Read', 'messages/update?group_id='.$group_id.'&seen=1'.$id_param, array('id' => 'markRead')) ?>
		</li>
		<?php endif ?>
	</ul>
</div>